import axios from 'axios'
import showMessage from '@/utils/showMessage'

const axiosIns = axios.create() // 创建实例
// 创建实例的拦截器
axiosIns.interceptors.response.use(function (res) {
	if (res.data.code !== 0) {
		showMessage({
			content: '' + res.data.msg,
			type: 'error',
			duration: 2000,
		})
	}
	return res.data.data
})

export default axiosIns
